package com.epfresh.api.entity;

import com.google.gson.Gson;

/**
 * Created by wzh on 16-7-6.
 */
public class City {

    private String cityId = "31";
    private String cityName = "上海市";

    private String addressId;
    private String addressIdCache;

    public String getAddressIdCache() {
        return addressIdCache;
    }

    public void setAddressIdCache(String addressIdCache) {
        this.addressIdCache = addressIdCache;
    }

    public String getAddressId() {
        return addressId;
    }

    public void setAddressId(String addressId) {
        this.addressId = addressId;
    }

    public String getCityId() {
        return cityId;
    }

    public void setCityId(String cityId) {
        this.cityId = cityId;
    }

    public String getCityName() {
        return cityName;
    }

    public void setCityName(String cityName) {
        this.cityName = cityName;
    }


    public void syncAddressId() {
        addressId = addressIdCache;
    }

    public String encrypt() {
        //可以再加密
        return new Gson().toJson(this);
    }

    public static City decrypt(String encryptStr) {
        //可以增加解密
        return new Gson().fromJson(encryptStr, City.class);
    }
}
